export default {
    namespaced: true,
    //state 必须是一个函数，
    // 因此可以创建多个实例化该模块
    state:()=>{
        return {list:[],obj:{},data:[],number:0}
    },
    actions:{
        setlist:({commit},data)=>{
            commit('setlist',data);
        },
        setobj:({commit},data)=>{
            commit('setobj',data);
        },
        setdata:({commit},data)=>{
            commit('setdata',data);
        },setnumber:({commit})=>{
          return  commit('setnumber')
        }
    },
    mutations:{
        setlist:(state,data)=>{
            state.list=data
        },setobj:(state,data)=>{
            state.obj=data
        },setdata:(state,data)=>{
            state.data=data
        },setnumber:(state)=>{
            state.number+=1;
        }
    }
}